home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / linuxcon.000 / linuxcon / linuxconf-1.6 / dialog / dialog.c < prev    next >
C/C++ Source or Header  |  1996-07-31  |  1KB  |  63 lines

  1. #pragma implementation
  2. #include "diadef.h"
  3. #include "dialog.h"
  4. /*
  5.     Update all variables with the edition buffer.
  6. */
  7. PUBLIC void DIALOG::save()
  8. {
  9.     for (int i=0; i<getnb(); i++){
  10.         FIELD *fi = getitem(i);
  11.         if (!fi->is_readonly()) fi->save();
  12.     }
  13.     rstmodified();
  14. }
  15. /*
  16.     Set all variables to its original content.
  17. */
  18. PUBLIC void DIALOG::restore()
  19. {
  20.     for (int i=0; i<getnb(); i++){
  21.         FIELD *fi = getitem(i);
  22.         if (!fi->is_readonly()) fi->restore();
  23.     }
  24. }
  25. /*
  26.     Return != 0 if anyone field has been modified
  27. */
  28. PUBLIC int DIALOG::was_modified()
  29. {
  30.     modified = 0;
  31.     return ARRAY::was_modified();
  32. }
  33.  
  34. PUBLIC FIELD *DIALOG::getitem(int no)
  35. {
  36.     return (FIELD*)ARRAY::getitem(no);
  37. }
  38.  
  39. void dialog_clear()
  40. {
  41.     if (dialog_mode != DIALOG_HTML){
  42.         init_dialog();
  43.         attr_clear(stdscr, LINES, COLS, screen_attr);
  44.     }
  45. }
  46.  
  47. PUBLIC FIELD_MSG::FIELD_MSG()
  48. {
  49.     is_loaded = 0;
  50. }
  51.  
  52.  
  53. /*
  54.     Record the icon name (no extension) which describe this dialog.
  55.     This will often be a translatable name (uh ?) allowing different icons
  56.     for different culture/language/society
  57. */
  58. PUBLIC void DIALOG::seticon (const char *_icon)
  59. {
  60.     icon.setfrom (_icon);
  61. }
  62.  
  63.